﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WFAExamAuto.SysSettings
{
    public partial class frmUser : Form
    {
       public FrmMain fmain;
        public frmUser()
        {
            InitializeComponent();
        }

        private void frmUser_Load(object sender, EventArgs e)
        {
            txtUserName.Text = Properties.Settings.Default.UserName;
            DataTable dt = fmain.cps.Pro_GetUserByName(txtUserName.Text);

            txtPwd.Text = dt.Rows[0][2].ToString();
            txtUserLever.Text = dt.Rows[0][3].ToString();
            txtRealName.Text = dt.Rows[0][4].ToString();
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            fmain.cps.Pro_UpdateUser(txtUserName.Text,txtRealName.Text,Convert.ToInt32(txtUserLever.Text),txtPwd.Text,txtUserName.Text);
            this.Close();
        }
    }
}
